package com.zkzx.common.truck.constants;

import com.zkzx.common.constants.NationalityEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;

/**
 * @author young Email:yanghui@zkraising.com
 * @description 运行性质
 * @company 北京中科智兴物联科技有限公司 @版权所有
 * @since 2021年05月10日 15时38分
 */
@Getter
@AllArgsConstructor
public enum OperationEnum {

    FAMILY_CAR("1","家庭自用汽车"),

    NO_BUSINESS_BUS("2","非营业客车"),

    BUSINESS_BUS("3","营业客车"),

    NO_BUSINESS_TRUCK("4","非营业货车"),

    BUSINESS_TRUCK("5","营业货车"),

    SPECIAL_VEHICLE("6","特种车"),

    MOTORCYCLE("7","摩托车"),

    TRACTOR("8","拖拉机"),

    TRAILER("9","挂车");

    private String code;

    private String value;

    public static String getNameByValue(final String value){
        return Arrays.stream(OperationEnum.values()).filter(operation -> operation.getValue().equals(value)).findFirst().map(Enum::name).orElse(null);
    }
}
